package com.ssn.mediator.chatroom;

public class TRoom extends VRoom{
    @Override
    public void sendText(String text) {
        System.out.println(textFilter(text));
    }

    @Override
    public void sendImage(String img) {
        if (checkImage(img)){
            System.out.println(img);
        }else{
            System.out.println("图片过大！");
        }
    }
    private String textFilter(String msg){
        return msg.replaceAll("[Tt][Mm][Dd]","***");
    }
    private boolean checkImage(String img){
        return img.length() <= 10;
    }
}
